trying to print a sorted dictionary but it gives me syntax error